<template>
  <view class="health-page">
    <!-- 左上角返回按钮 -->
    <view class="nav-back" @click="goBack">
      <text class="nav-back-icon">←</text>
    </view>
    <view class="card">
      <text class="title">健康咨询</text>
      <text class="desc">此页面将提供健康知识、咨询入口与在线客服，后续可接入文章列表与IM客服。</text>
      <button class="btn" type="primary" @click="go">开始咨询（占位）</button>
    </view>
  </view>
</template>

<script>
export default {
  methods: {
    go() {
      this.$modal && this.$modal.msg('健康咨询功能开发中')
    },
    goBack() {
      const pages = getCurrentPages && getCurrentPages()
      if (pages && pages.length > 1) {
        uni.navigateBack({ delta: 1 })
      } else {
        uni.switchTab ? uni.switchTab({ url: '/pages/index' }) : uni.reLaunch({ url: '/pages/index' })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.health-page { background: #f5f5f5; min-height: 100vh; padding: 24rpx; }
.card { background:#fff; border-radius: 20rpx; padding: 32rpx; box-shadow: 0 6rpx 20rpx rgba(0,0,0,0.04); }
.title { font-size: 34rpx; font-weight: 600; color: #333; }
.desc { display:block; margin: 16rpx 0 24rpx; color:#777; font-size: 26rpx; line-height: 1.6; }
.btn { width: 100%; }

/* 左上角返回按钮 */
.nav-back {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 999;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-back-icon { color: #333; font-size: 18px; line-height: 1; }
</style>
